package com.wza.designPattern.FactoryPattern;

import com.wza.designPattern.interfaces.Shape;

/**
 * 工厂类
 * @author Administrator
 * @version [版本号, 2018/11/20]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class ShapeFactoryDemo
{
    public static void main(String[] args)
    {
        // 可使用枚举类型作为参数传入
        Shape circle = ShapeFactory.getShape("CIRCLE");
        circle.draw();

        Shape retangle = ShapeFactory.getShape("RECTANGLE");
        retangle.draw();

        Shape square = ShapeFactory.getShape("SQUARE");
        square.draw();
    }
}
